package com.bruce.asurada.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.bruce.asurada.common.Result;
import com.bruce.asurada.common.dto.*;

/**
 * 用户服务Feign客户端
 */
@FeignClient(name = "asurada-user", path = "/user")
public interface UserServiceFeign {

    /**
     * 用户注册
     */
    @PostMapping("/register")
    public Result<Void> register(@Validated @RequestBody UserRegisterDto registerDto) throws Exception;


    /**
     * 登录获取用户信息
     */
    @PostMapping("/login")
    public Result<UserInfoDto> login(@RequestBody UserLoginDto loginDto) throws Exception;

    /**
     * 获取用户信息
     */
    @PostMapping("/info")
    public Result<UserInfoDto> getUserInfo(@RequestBody UserQueryDTO queryDTO) throws Exception;

}
